package top.rainf.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.rainf.domain.vo.History;
import top.rainf.mapper.HistoryMapper;
import top.rainf.service.IHistoryService;

import java.util.List;

/**
 * @author 星环
 * @date Wed May 10 21:04:41 CST 2023
 * @description History服务的实现类
 */
@Service
public class HistoryService implements IHistoryService {

    @Autowired
    HistoryMapper historyMapper;

    @Override
    public List<History> getHistoryList() {
        return historyMapper.selectAll();
    }



    @Override
    public History getOneById(int id) {
        return historyMapper.selectById(id);
    }

    @Override
    public boolean deleteOneById(int id) {
        return historyMapper.deleteById(id) == 1;
    }

    @Override
    public boolean deleteAll(List<Integer> idList) {
        return historyMapper.deleteByIds(idList) == idList.size();
    }

    @Override
    public boolean updateById(History history) {
        return historyMapper.updateById(history) == 1;
    }
}
